<?php
/*
Esta es la clase que procesa LA DEFINICIÓN del usercontrol
*/
class UserControlParser extends ContainerParser
{
	public static $allowed_extensions = array("control", "ascx");

	protected function getAllowedExtensions()
	{
		return UserControlParser::$allowed_extensions;
	}
	
	protected function parseContainerDeclaration($str)
	{
		//sacar el primer palabro
		$rex2 = "/\\b\\w+?\\b/";
		preg_match($rex2, $str, $firstWord);
		if($firstWord[0]!="Control")
		{
			throw new Exception("Expecting control declaration, found '".$firstWord[0]."'\n");
		}
		else
		{
			$cnt = preg_match("/\\bCodefile=\"(\\w+?)\"/i", $str, $match);
			if($cnt>0)
				$this->code_file = $match[1];
				
			$cnt = preg_match("/\\ClassName=\"(\\w+?)\"/i", $str, $match);
			if($cnt>0)
				$this->class_name = $match[1];
		}
	}
	
	public function getInitCode($rootParser)
 	{
 		//esto no pasará nunca
 	} 	
}

?>